// 基于template/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{spinalCase ctrl.codeName}}-grid-model.ts.hbs生成
import { IGridModel, IParam, isEmpty, VerifyUtil } from '@/core';

function getModel(): IGridModel {
	return {
        cssName: "",        
		aggMode: 'NONE',
		caption: '',
		controlType: 'GRID',
		codeName: 'Gridexpbar_grid',      
		columns: getGridColumns(),
		dataItems: getGridDataItems(),
		dataExport: getDataExport(),
		enableRowEdit: false,
		entityCodeName: 'IBIZBOOK',
		entityLogicName: '图书',
		createDefaultItems: getCreateDefaultItems(),
        updateDefaultItems: getUpdateDefaultItems(),
		name: 'gridexpbar_grid',
		noSort: false,
		rules: {
            //	静态值规则
            staticRules: {
		    },
            //	编辑项值规则
            editRules: [
			]
    	},
		showHeader: true,
		sortDir: '',
		sortField: '',
		limit: 20,
		dataImport: {
			codeName: 'DataImport',
			ignoreError: false,
			importItems: [
				{
					name: 'author',
					caption: App.ts('DEF.LNAME.AUTHOR', '图书作者'),
				},
				{
					name: 'booknumber',
					caption: App.ts('DEF.LNAME.BOOKNUMBER', '图书数量'),
				},
				{
					name: 'borrowway',
					caption: App.ts('DEF.LNAME.BORROWWAY', '借阅方式'),
					codeListTag: 'Sample__CodeList25',
				},
				{
					name: 'ibizbookid',
					caption: App.ts('DEF.LNAME.IBIZBOOKID', '图书标识'),
				},
				{
					name: 'ibizbookname',
					caption: App.ts('DEF.LNAME.IBIZBOOKNAME', '图书名称'),
				},
				{
					name: 'press',
					caption: App.ts('DEF.LNAME.PRESS', '图书出版社'),
				},
				{
					name: 'price',
					caption: App.ts('DEF.LNAME.PRICE', '图书价格'),
				},
				{
					name: 'sailstate',
					caption: App.ts('DEF.LNAME.SAILSTATE', '图书销售状态'),
					codeListTag: 'Sample__BookSailState',
				},
				{
					name: 'subtext',
					caption: App.ts('DEF.LNAME.SUBTEXT', '图书描述'),
				},
				{
					name: 'tag',
					caption: App.ts('DEF.LNAME.TAG', '标签'),
				},
				{
					name: 'type',
					caption: App.ts('DEF.LNAME.TYPE', '图书类型'),
					codeListTag: 'Sample__BookType',
				}
			]
		},
		ctrlMsgModel:[
    ],
		uiEngineModel: [
            {
                name: 'gridexpbar_selectionchange',
                triggerType: 'CTRLEVENT',
                logicType: 'CUSTOM',
                eventNames: 'SELECTIONCHANGE',
                scriptCode: ``,
                entityCodeName: '',
                logicName:``
            },
            {
                name: 'gridexpbar_load',
                triggerType: 'CTRLEVENT',
                logicType: 'CUSTOM',
                eventNames: 'LOAD',
                scriptCode: ``,
                entityCodeName: '',
                logicName:``
            }
    ]
    }
}
//  获取所有表格列模型
function getGridColumns():IParam[] {
  return [
  ];
}

//  获取所有表格数据项
function getGridDataItems() {
  return [
  ];
}

function getDataExport() {
	return {
        default: true,
		codeName: 'default',
		enableFront: true,
		fileName: '图书',
		exportItems: [
		]
	}
}

function getCreateDefaultItems() {
	return [
	]
}

function getUpdateDefaultItems() {
	return [
	];
}

export const model = getModel();